<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    const origin = {
        name:"origin"
    }

    const target = new Proxy(origin, {
        get(origin, attr){
            console.log(`正在访问${origin.name}的${attr}属性`)
            return origin[attr];
        },
        set(origin, attr, val){
            console.log(`正在修改${origin.name}的${attr}属性，值为${val}`)
            origin[attr] = val;
        }
    })

    console.log(target);
    
    target.abc
    target.qwe
    target.asd = "hello"
    
    console.log(target);

    
</script>
</html>